﻿using Metro.Demo.Model;
using Prism.Mvvm;
using System;
using System.Collections.ObjectModel;

namespace Metro.Demo.ViewModels
{
    public class ProductViewModel : BindableBase
    {

        public ObservableCollection<ProductModel> _products;

        public ObservableCollection<ProductModel> ProductList
        {
            get { return _products; }
            set
            {
                SetProperty(ref _products, value);
                RaisePropertyChanged("Products");
            }
        }

        public ProductViewModel()
        {
            InitProductList();
        }

        private void InitProductList()
        {
            ProductList = new ObservableCollection<ProductModel>()
            {
                new ProductModel() { Id =1, BarCode="1234567890", ProductName="西安力矩100",SNExample = "4522TKU2H143HG1341",ImgNum = 2,Status =1, CreateTime = DateTime.Now },
                new ProductModel() { Id =2, BarCode="1234567891", ProductName="测试123",SNExample = "4522TKU2H143HG1326",ImgNum = 3,Status =1, CreateTime = DateTime.Now },
                new ProductModel() { Id =3, BarCode="1234567892", ProductName="啊哈人",SNExample = "4522TKU2H143HG1335",ImgNum = 4,Status =1, CreateTime = DateTime.Now },
                new ProductModel() { Id =4, BarCode="1234567893", ProductName="合肥充电桩",SNExample = "4522TKU2H143HG1583",ImgNum = 2, Status =1,CreateTime = DateTime.Now },
            };
        }
    }
}
